package com.ruoyi.wisdom.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wisdom.mapper.IotPickDeviceMapper;
import com.ruoyi.wisdom.domain.IotPickDevice;
import com.ruoyi.wisdom.service.IIotPickDeviceService;

/**
 * 设备管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-31
 */
@Service
public class IotPickDeviceServiceImpl implements IIotPickDeviceService {
    @Autowired
    private IotPickDeviceMapper iotPickDeviceMapper;

    /**
     * 查询设备管理
     *
     * @param id 设备管理主键
     * @return 设备管理
     */
    @Override
    public IotPickDevice selectIotPickDeviceById(Long id) {
        return iotPickDeviceMapper.selectIotPickDeviceById(id);
    }

    @Override
    public IotPickDevice selectIotPickDevice(IotPickDevice iotPickDevice) {
        return iotPickDeviceMapper.selectIotPickDevice(iotPickDevice);
    }


    /**
     * 查询设备管理列表
     *
     * @param iotPickDevice 设备管理
     * @return 设备管理
     */
    @Override
    public List<IotPickDevice> selectIotPickDeviceList(IotPickDevice iotPickDevice) {
        return iotPickDeviceMapper.selectIotPickDeviceList(iotPickDevice);
    }

    /**
     * 新增设备管理
     *
     * @param iotPickDevice 设备管理
     * @return 结果
     */
    @Override
    public int insertIotPickDevice(IotPickDevice iotPickDevice) {
        iotPickDevice.setCreateTime(DateUtils.getNowDate());
        return iotPickDeviceMapper.insertIotPickDevice(iotPickDevice);
    }

    /**
     * 修改设备管理
     *
     * @param iotPickDevice 设备管理
     * @return 结果
     */
    @Override
    public int updateIotPickDevice(IotPickDevice iotPickDevice) {
        iotPickDevice.setUpdateTime(DateUtils.getNowDate());
        return iotPickDeviceMapper.updateIotPickDevice(iotPickDevice);
    }

    /**
     * 批量删除设备管理
     *
     * @param ids 需要删除的设备管理主键
     * @return 结果
     */
    @Override
    public int deleteIotPickDeviceByIds(Long[] ids) {
        return iotPickDeviceMapper.deleteIotPickDeviceByIds(ids);
    }

    /**
     * 删除设备管理信息
     *
     * @param id 设备管理主键
     * @return 结果
     */
    @Override
    public int deleteIotPickDeviceById(Long id) {
        return iotPickDeviceMapper.deleteIotPickDeviceById(id);
    }

    /**
     * 更新设备在线
     * @return
     */
    @Override
    public int updateIotPickDeviceOnline(IotPickDevice iotPickDevice) {
        return iotPickDeviceMapper.updateIotPickDeviceOnline(iotPickDevice);
    }
}
